# -*- coding: utf-8 -*-
import multiprocessing
import time


def task(num):
    time.sleep(1)
    print('num:', num)
    return num ** 2


if __name__ == "__main__":
    processes = 100  # 需要启动的进程个数

    pool = multiprocessing.Pool()
    result = pool.map(task, [i for i in range(processes)])
    print(result)
